//
//  LcText.m
//  18Birdies
//
//  Created by poleness on 2017/4/25.
//  Copyright © 2017年 Lc. All rights reserved.
//

#import "LcText.h"

@implementation LcText

- (instancetype _Nonnull)initWithText:(NSString* _Nullable)text lcFont:(LcFont* _Nonnull)lcFont {
  self = [super init];
  if (self) {
    self->_text = text != nil ? text : @"";
    self.lcFont = lcFont;
  }
  return self;
}

- (CGFloat)height {
  return [self heightWithMaxWidth:CGFLOAT_MAX];
}

- (CGFloat)heightWithMaxWidth:(CGFloat)width {
  return [self.text heightOfFont:self.lcFont.font andWidth:width];
}

@end
